package com.fsc.order.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.fsc.order.model.TestOrder;
import com.fsc.order.service.TestOrderService;

/**
* @comments
* @author  zg
* @date 2018年8月29日
*/
@RestController
@RequestMapping("order/test/")
public class TestOrderController {

	private final Logger logger = LoggerFactory.getLogger(this.getClass());
	
	@Autowired
	private TestOrderService testOrderService;
	
	@RequestMapping("hello")
	public Object test() {
		logger.info("hello-order");
		return "success:hello-order";
	}
	
	@RequestMapping("db")
	public Object db(@RequestParam(name = "id", required = false, defaultValue = "0") Integer id) {
		TestOrder to = testOrderService.getById(id);
		logger.info("查询到：", to);
		return to;
	}
	
	
}
